<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>Title</title>
  </head>

  <body>
    <h2>JavaScript 能做什么？</h2>

    <p>JavaScript 能够改变 HTML 属性值。</p>

    <p>在本例中，JavaScript 改变了图像的 src 属性值。</p>

    <button onclick="document.getElementById('myImage').src='../images/eg_bulbon.gif'">开灯</button>

    <img id="myImage" border="0" src="../images/eg_bulboff.gif" style="text-align:center;">

    <button onclick="document.getElementById('myImage').src='../images/eg_bulboff.gif'">关灯</button>
  </body>
</html>